<html>
<head><meta charset="utf-8"><title>Parallel rustc - Mir predecessors cache · t-compiler/wg-mir-opt · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/index.html">t-compiler/wg-mir-opt</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html">Parallel rustc - Mir predecessors cache</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="176004636"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176004636" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176004636">(Sep 18 2019 at 13:28)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> this is related to the <code>mir cache predecessors</code> topic in <a class="stream" data-stream-id="187679" href="/#narrow/stream/187679-t-compiler.2Fwg-parallel-rustc">#t-compiler/wg-parallel-rustc</a>. So I think your idea of the separate query makes a lot of sense. I only didn't understand the part about the passes that need mutable access to the cache will have access anyways. Here are you implying that only the passes that generate the cache will need mutable access?</p>
<p>While reviewing the code last week, I saw that the only mutable access currently implemented is to simply wipe the cache when the basic blocks are updated, and the next read recomputes the cache.</p>



<a name="176004831"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176004831" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176004831">(Sep 18 2019 at 13:30)</a>:</h4>
<p>I checked the read sites, and I think all of them are either after after the <code>optimized_mir</code> query is done, or during optimizations</p>



<a name="176004835"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176004835" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176004835">(Sep 18 2019 at 13:30)</a>:</h4>
<p>How would that fit in with separate passes? Would this simply mean that a modification of the cache and a following read would cause the pass to be run again? (Which I thought was not possible since pass results are immutably cached) or does this never actually occur? I'm also not sure if this still holds when the compiler is processing the queries in parallel</p>



<a name="176004846"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176004846" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176004846">(Sep 18 2019 at 13:30)</a>:</h4>
<p>Separating the queries is thus unnecessary I believe</p>



<a name="176004857"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176004857" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176004857">(Sep 18 2019 at 13:30)</a>:</h4>
<p>Oh you just answered my second question <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="176004875"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176004875" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176004875">(Sep 18 2019 at 13:31)</a>:</h4>
<p>we can simply remove all interior mutability and panic if it's still <code>None</code> when needed</p>



<a name="176005090"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176005090" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176005090">(Sep 18 2019 at 13:33)</a>:</h4>
<p>I'm not sure I'm following 100%. You're saying we should disallow invalidation of the cache?</p>



<a name="176005387"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176005387" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176005387">(Sep 18 2019 at 13:36)</a>:</h4>
<p>Actually, let me follow up when I'm back to my laptop.</p>



<a name="176005567"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176005567" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176005567">(Sep 18 2019 at 13:38)</a>:</h4>
<p>ah, no, invalidation can only happen while we have mutable access, because invalidation happens when mutating the body</p>



<a name="176005589"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176005589" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176005589">(Sep 18 2019 at 13:39)</a>:</h4>
<p>so we can just set it to <code>None</code>, but that doesn't need interior mutability</p>



<a name="176005644"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176005644" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176005644">(Sep 18 2019 at 13:39)</a>:</h4>
<p>whenever we need it and have mutable access, we can reinitialize it (or just read it if it's Some)</p>



<a name="176005716"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176005716" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176005716">(Sep 18 2019 at 13:40)</a>:</h4>
<p>so nothing changes about the status quo, except that we have two "read" accessors</p>



<a name="176005724"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176005724" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176005724">(Sep 18 2019 at 13:40)</a>:</h4>
<p>one with <code>&amp;mut</code> that initializes if necessary</p>



<a name="176005737"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176005737" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176005737">(Sep 18 2019 at 13:40)</a>:</h4>
<p>and one with <code>&amp;</code> that panics if <code>None</code></p>



<a name="176005777"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176005777" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176005777">(Sep 18 2019 at 13:41)</a>:</h4>
<p>we'll also need a dummy pass at the end of the pipeline that does nothing but initialize the cache</p>



<a name="176005808"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176005808" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176005808">(Sep 18 2019 at 13:41)</a>:</h4>
<p>after optimizations it will be needed at least once, so we don't lose anything by computing the cache eagerly</p>



<a name="176050046"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176050046" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176050046">(Sep 18 2019 at 21:53)</a>:</h4>
<p>Sorry for the delay. Traveling to Sunnyvale today and had some surprises pop up in the morning. I might be able to start serious work on this Friday and if not then sometime in the weekend.</p>



<a name="176099979"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176099979" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176099979">(Sep 19 2019 at 13:40)</a>:</h4>
<p>no pressure! Take all the time you need</p>



<a name="176326459"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176326459" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176326459">(Sep 22 2019 at 21:14)</a>:</h4>
<p>So I implemented your suggestion, but I still feel worried about this approach (still compiling at the moment, but I'm pretty sure this is going to crash). All readers of the predecessors only ever wanted immutable read access. However, the code that invalidates the predecessors happens more frequently. I did a regex search against <code>basic_body_.*?mut</code> and found with 27 instances that would invalidate the predecessors cache. The other issue I ran into is that it seems interior mutability was being used to avoid a clone when requesting the predecessors. It was being called as <code>self.cache.predecessors(self)</code>, where self was of type <code>&amp;Body&lt;...&gt;</code>. When changing this to not use interior mutability, that means I need cache to be <code>&amp;mut self</code> in <code>predecessors_mut</code>, but this requires that <code>self: &amp;mut Body&lt;...&gt;</code>. That won't compile because the passed <code>self</code> is already borrowed. I can get around this by cloning <code>self: &amp;Body&lt;...&gt;</code>, but that doesn't seem ideal for performance.</p>



<a name="176326524"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176326524" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176326524">(Sep 22 2019 at 21:16)</a>:</h4>
<p>I think what I'll do later tonight (have to step out for a few hours) if not tomorrow evening, is try to manually map out where the cache is being invalidated and where's it's being read (and would possibly require unique access to the cache to recompute).</p>



<a name="176326614"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176326614" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176326614">(Sep 22 2019 at 21:19)</a>:</h4>
<p>There were also notes left in the comments about maybe implementing a more intelligent cache that only cleared what was needed. Do you think now might be a good opportunity to revisit that idea, or only once the interior mutability is all cleared up?</p>



<a name="176326666"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176326666" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176326666">(Sep 22 2019 at 21:20)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/blob/master/src/librustc/mir/cache.rs#L42" target="_blank" title="https://github.com/rust-lang/rust/blob/master/src/librustc/mir/cache.rs#L42">https://github.com/rust-lang/rust/blob/master/src/librustc/mir/cache.rs#L42</a> is the comment I'm referring to.</p>



<a name="176366757"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176366757" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176366757">(Sep 23 2019 at 13:13)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> whenever you're free ^. Side question: what's the etiquette for pinging people in Zulip? I wasn't sure if pinging every time I had a question would be too annoying, or useful as a way to focus someone where they're needed</p>



<a name="176426298"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176426298" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176426298">(Sep 24 2019 at 02:07)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> I found one spot where the predecessors are read and then immediately written over (the mut access will invalidate the cache):<br>
<a href="https://github.com/rust-lang/rust/blob/master/src/librustc_mir/transform/add_call_guards.rs#L42-L49" target="_blank" title="https://github.com/rust-lang/rust/blob/master/src/librustc_mir/transform/add_call_guards.rs#L42-L49">https://github.com/rust-lang/rust/blob/master/src/librustc_mir/transform/add_call_guards.rs#L42-L49</a></p>



<a name="176426356"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176426356" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176426356">(Sep 24 2019 at 02:08)</a>:</h4>
<p>Is it possible that other optimizations could be running at the same time this is being computed?</p>



<a name="176426361"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176426361" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176426361">(Sep 24 2019 at 02:08)</a>:</h4>
<p>Or is this an instance where I should be accessing the mutable variant of predecessors?</p>



<a name="176441579"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176441579" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176441579">(Sep 24 2019 at 08:13)</a>:</h4>
<p>pinging is fine (at least for me :D)</p>



<a name="176441964"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176441964" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176441964">(Sep 24 2019 at 08:19)</a>:</h4>
<p>So... multiple things:</p>
<ol>
<li>probably not all <code>basic_block_mut</code> calls actually mutate the terminator's targets or the number of blocks, maybe we should find a scheme for that</li>
<li>Unfortunately I can't quite follow what you're saying about multiple mutable borrows, can you push some code that I can look at?</li>
<li>the comment may be referring to 1. because otherwise I have no idea how to approach a partial invalidation</li>
</ol>



<a name="176461662"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176461662" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176461662">(Sep 24 2019 at 13:10)</a>:</h4>
<p>I opened a draft PR here <a href="https://github.com/rust-lang/rust/pull/64736" target="_blank" title="https://github.com/rust-lang/rust/pull/64736">https://github.com/rust-lang/rust/pull/64736</a></p>



<a name="176461808"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176461808" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176461808">(Sep 24 2019 at 13:12)</a>:</h4>
<p>This is the line I can't figure out how to avoid a clone on <a href="https://github.com/rust-lang/rust/pull/64736/files#diff-f0577ac900ffbd36d3bb3421a928cbbdR234" target="_blank" title="https://github.com/rust-lang/rust/pull/64736/files#diff-f0577ac900ffbd36d3bb3421a928cbbdR234">https://github.com/rust-lang/rust/pull/64736/files#diff-f0577ac900ffbd36d3bb3421a928cbbdR234</a></p>



<a name="176461880"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176461880" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176461880">(Sep 24 2019 at 13:13)</a>:</h4>
<p>I'll think about options for 1. I need to run to work for the moment, but I should be back online late tonight to continue working through ideas. I'll follow up with you tomorrow morning</p>



<a name="176462564"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176462564" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176462564">(Sep 24 2019 at 13:20)</a>:</h4>
<p>I posted some comments on the PR</p>



<a name="176475725"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176475725" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176475725">(Sep 24 2019 at 15:34)</a>:</h4>
<p>I took a look. Moving the cache into <code>Body</code> makes a lot more sense than the idea I was sitting on <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="176475735"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176475735" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176475735">(Sep 24 2019 at 15:34)</a>:</h4>
<p>I'll address those tonight</p>



<a name="176526163"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176526163" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176526163">(Sep 25 2019 at 01:48)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> the latest changes are up. My only hesitation with the current impl is this: since the predecessors are only calculated on read of a mut <code>Body</code>, what guarantees that they're computed before they're being read, e.g. in nll? The scenario I'm thinking of is this: Most of the optimizations on MIR will invalidate the predecessors cache, since they request mutable access to the basic blocks, but what code has mutable access to a <code>Body</code> that guarantees that this cache is regenerated when needed? Is it possible we need some pass where we can ensure that the cache is complete and immutable for later parts of the compiler?</p>



<a name="176526468"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176526468" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176526468">(Sep 25 2019 at 01:54)</a>:</h4>
<p>I've also been thinking about a way to more intelligently update the cache. What if rather than doing a full wipe-out, we had a way to track which blocks were changed during a mutation event, and update the predecessors immediately after that block completed? E.g. something like (fair warning, I'm terrible at naming things on a first pass):</p>
<div class="codehilite"><pre><span></span>body.track_body_changes(|&amp;mut basic_blocks| -&gt; {
  basic_blocks.add_terminator(...) // gets tracked for cache
  basic_blocks.move_terminator(...) // gets tracked for cache
  basic_blocks.simplify_interior_of_block(..) // ignored so it&#39;s not touching terminators
}) // after the lambda executes, but before the fn returns, the predecessors cache is recomputed
</pre></div>


<p>This would ensure there's always a cache to look at, but would avoid updating it too frequently. It might also save us from the excessive invalidation that currently happens (invalidate is called really frequently). However, I'm not sure how this is any better than just adding a method calls for terminators specifically, that will add to a predecessors lookup. I.e., special methods for modifying terminators since those are the only ones that would affect predecessors.</p>



<a name="176540520"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176540520" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176540520">(Sep 25 2019 at 07:36)</a>:</h4>
<blockquote>
<p>Is it possible we need some pass where we can ensure that the cache is complete and immutable for later parts of the compiler?</p>
</blockquote>
<p>yes definitely, this must be the final pass</p>



<a name="176540580"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176540580" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176540580">(Sep 25 2019 at 07:37)</a>:</h4>
<p>wrt updating, I think a scheme similar to what you are suggesting is possible, though I worry whether it will get very complex if we want to truly prevent all irrelevant mutations from requiring cache recomputation</p>



<a name="176540642"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176540642" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176540642">(Sep 25 2019 at 07:38)</a>:</h4>
<p>e.g. think about modifying the conditions of a terminator. This does not affect the predecessor cache</p>



<a name="176540682"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176540682" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176540682">(Sep 25 2019 at 07:39)</a>:</h4>
<p>maybe we could start out with a <code>body.block_statements_mut()</code> function that does not invalidate and see how far that gets us?</p>



<a name="176563510"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176563510" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176563510">(Sep 25 2019 at 13:22)</a>:</h4>
<blockquote>
<p>e.g. think about modifying the conditions of a terminator. This does not affect the predecessor cache</p>
</blockquote>
<p>I think if we can figure out a way to only invalidate on terminator changes (and not on any basic block changes), that might still be useful. I agree there's definitely a point of diminishing returns that won't be useful to pursue.</p>



<a name="176564380"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176564380" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176564380">(Sep 25 2019 at 13:31)</a>:</h4>
<p>I did a quick search, and it seems terminators are only created/modified through <code>BasicBlockData</code>'s <code>terminator_mut</code> (please correct me if I've missed something) and I only found 13 instances of this being used. I'm thinking  maybe we can have those be managed by the Body type in some form so that the cache just for those specific terminators can be invalidated. I'll try playing around with that tonight. I'll also move it to a separate branch so we can do perf comparisons against any other ideas that come up.</p>



<a name="176564674"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176564674" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176564674">(Sep 25 2019 at 13:34)</a>:</h4>
<p>This fits into the scheme of having a <code>statements_mut</code> function</p>



<a name="176564724"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176564724" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176564724">(Sep 25 2019 at 13:35)</a>:</h4>
<p>(which doesn't invalidate)</p>



<a name="176745499"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176745499" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176745499">(Sep 27 2019 at 13:30)</a>:</h4>
<p>Latest changes are up here: <a href="https://github.com/rust-lang/rust/pull/64841" target="_blank" title="https://github.com/rust-lang/rust/pull/64841">https://github.com/rust-lang/rust/pull/64841</a><br>
I made a new PR since I wasn't sure if we were committed to this specific change or not. If you think all of this should be in the same PR, I'll close this one and update the original one.</p>



<a name="176745521"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176745521" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176745521">(Sep 27 2019 at 13:30)</a>:</h4>
<p>I'm also still missing the final pass to ensure the creation of the cache before the read-only phases.</p>



<a name="176745597"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176745597" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176745597">(Sep 27 2019 at 13:31)</a>:</h4>
<p>Is it correct to assume I should add it to this list: <a href="https://github.com/rust-lang/rust/blob/master/src/librustc_mir/transform/mod.rs#L228" target="_blank" title="https://github.com/rust-lang/rust/blob/master/src/librustc_mir/transform/mod.rs#L228">https://github.com/rust-lang/rust/blob/master/src/librustc_mir/transform/mod.rs#L228</a></p>



<a name="176745681"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176745681" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176745681">(Sep 27 2019 at 13:32)</a>:</h4>
<p>Also, if this is the correct place to modify, would it go just before the <code>dump</code> pass, or do you think there's a more ideal location to run that kind of pass?</p>



<a name="176745690"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176745690" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176745690">(Sep 27 2019 at 13:33)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> , whenever you're free ^</p>



<a name="176746329"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176746329" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176746329">(Sep 27 2019 at 13:41)</a>:</h4>
<p>yea it could definitely be infront of the <code>dump</code> pass</p>



<a name="176746350"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176746350" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176746350">(Sep 27 2019 at 13:41)</a>:</h4>
<p>I'll look at the PR in detail later</p>



<a name="176746512"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176746512" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176746512">(Sep 27 2019 at 13:42)</a>:</h4>
<p>huh :D why is there a second PR?</p>



<a name="176746528"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176746528" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176746528">(Sep 27 2019 at 13:42)</a>:</h4>
<p>ah you wrote that above</p>



<a name="176746534"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176746534" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176746534">(Sep 27 2019 at 13:42)</a>:</h4>
<p>yea do everything in the one PR</p>



<a name="176746656"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176746656" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176746656">(Sep 27 2019 at 13:44)</a>:</h4>
<p>hmm.. oh that's about the smart invalidation?</p>



<a name="176746666"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176746666" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176746666">(Sep 27 2019 at 13:44)</a>:</h4>
<p>yea that shouldn't be intermingled</p>



<a name="176746678"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176746678" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176746678">(Sep 27 2019 at 13:44)</a>:</h4>
<p>The first PR shouldn't optimize the invalidation</p>



<a name="176746685"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176746685" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176746685">(Sep 27 2019 at 13:44)</a>:</h4>
<p>just keeping the status quo is ok</p>



<a name="176747698"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176747698" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176747698">(Sep 27 2019 at 13:56)</a>:</h4>
<p>Ok, I'll get to that at lunch time. I assume you'll be reviewing that Monday due to time zones?</p>



<a name="176747895"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176747895" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176747895">(Sep 27 2019 at 13:58)</a>:</h4>
<p>maybe XD sometimes I find time on weekends, too</p>



<a name="176747912"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176747912" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176747912">(Sep 27 2019 at 13:58)</a>:</h4>
<p>did you change anything in the root PR?</p>



<a name="176747975"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176747975" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176747975">(Sep 27 2019 at 13:59)</a>:</h4>
<p>IIRC that just needs the mir pass regenerating the cache and it's done keeping the status quo alive</p>



<a name="176756521"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176756521" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176756521">(Sep 27 2019 at 15:28)</a>:</h4>
<p>In the root PR I haven't updated anything. You're saying just add the pass and then continue on this next PR?</p>



<a name="176819595"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176819595" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176819595">(Sep 28 2019 at 10:05)</a>:</h4>
<p>yes</p>



<a name="176830286"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176830286" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176830286">(Sep 28 2019 at 15:30)</a>:</h4>
<p>Ok, I think I've addressed everything. I also added comments on the PR about a couple areas I think could be improved as well as one single place I'm not sure how to enforce the use of the terminator lookup since it's inside of a macro that takes in the mutability during the call.</p>



<a name="176838668"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176838668" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176838668">(Sep 28 2019 at 19:41)</a>:</h4>
<p>So I started looking at why the CI was failing. Some lint checks failed, so I got those through, but now I'm running into one area that looks like it's going to explode in complexity without interior mutability. So currently, there's a <code>predecessors_for</code> fn that called <code>unwrap_predecessors</code> (it's one that I had a TODO on about whether that was the correct <code>*predecessors</code> fn to call). <code>predecessors_for</code> is called by a trait impl <code>impl &lt;Body as graph::WithPredecessors&gt;::predecessors</code>. The first time this is called, the cache hasn't been computed, so the compiler panics. Changing this to use <code>predecessors</code> (which computes the cache) isn't possible because once we get to the <code>graph::WithPredecessors</code> trait, we're bound to use <code>&amp;self</code>. Assuming this even made sense (which I don't think it does), I could fix this instance by changing <code>WithPredecessors::predecessor</code> to take <code>&amp;mut self</code>, but that requires changing all other impls of that trait.</p>



<a name="176930693"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176930693" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176930693">(Sep 30 2019 at 13:18)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> whenever you're free, see the thread above</p>



<a name="176930737"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176930737" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176930737">(Sep 30 2019 at 13:18)</a>:</h4>
<p>yea :D the email notification about your PR is next on my list of things to process</p>



<a name="176930749"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176930749" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176930749">(Sep 30 2019 at 13:19)</a>:</h4>
<p>I'll look at it after work</p>



<a name="176930849"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176930849" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176930849">(Sep 30 2019 at 13:20)</a>:</h4>
<p>No rush, though the comment I have above is not mentioned in the PR. It's an overview of my review of the CI failures</p>



<a name="176954542"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176954542" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176954542">(Sep 30 2019 at 17:37)</a>:</h4>
<p>There's only a single impl of <code>WithPredecessors</code> (not counting tests), so yea, feel free to change the trait</p>



<a name="176954562"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176954562" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176954562">(Sep 30 2019 at 17:37)</a>:</h4>
<blockquote>
<p>Assuming this even made sense (which I don't think it does),</p>
</blockquote>



<a name="176954565"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176954565" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176954565">(Sep 30 2019 at 17:37)</a>:</h4>
<p>what do you mean by this?</p>



<a name="176954570"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176954570" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176954570">(Sep 30 2019 at 17:37)</a>:</h4>
<p>can you elaborate?</p>



<a name="176966502"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176966502" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176966502">(Sep 30 2019 at 19:42)</a>:</h4>
<p>Oh I didn't realize the other implementors were tests. I thought it was other parts of the compiler, and making all of them mut didn't make sense to me</p>



<a name="176966503"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176966503" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176966503">(Sep 30 2019 at 19:42)</a>:</h4>
<p>Sorry I missed that</p>



<a name="176978783"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/176978783" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#176978783">(Sep 30 2019 at 22:01)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span>  just got a chance to take a look again, and it's not just the tests. <code>librustc_data_structures/graph</code> also implements this trait, and trying to fix this is causing a trickling of errors that I have to keep fixing.</p>



<a name="177027869"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177027869" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177027869">(Oct 01 2019 at 06:41)</a>:</h4>
<p>hmm my grep foo must have failed me</p>



<a name="177027871"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177027871" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177027871">(Oct 01 2019 at 06:41)</a>:</h4>
<p>I thought the other uses were just generic forwardings</p>



<a name="177027923"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177027923" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177027923">(Oct 01 2019 at 06:42)</a>:</h4>
<p>maybe make the trait work on <code>self</code> instead of <code>&amp;self</code> or <code>&amp;mut self</code> and implement it for <code>&amp;Foo</code> and <code>&amp;mut Bar</code></p>



<a name="177047465"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177047465" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177047465">(Oct 01 2019 at 11:55)</a>:</h4>
<p>All this time and I never even knew you could do that... Ok I'll work on that this morning. Thanks!</p>



<a name="177054250"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177054250" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177054250">(Oct 01 2019 at 13:22)</a>:</h4>
<p>So I was confused for a bit until I took a step back and reviewed how all of the code is connected. Your suggestion won't work because I hadn't realized that the methods in <code>librustc_data_structures</code> are actually being called against <code>&amp; &amp;mut Body</code> (after my changes, previously, it was <code>&amp;&amp;Body</code> where <code>&amp;Body</code> was abstracted behind some generic type <code>G</code>), but they're being made to work against any type that implements <code>ControlFlowGraph</code>, which all expect some <code>&amp;T</code>. Implementing <code>WithPredecessors::predecessor(self, ...)</code> would require me to convert <code>&amp;&amp;Body</code> to <code>&amp;mut Body</code>.</p>



<a name="177054840"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177054840" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177054840">(Oct 01 2019 at 13:29)</a>:</h4>
<p><span aria-label="frown" class="emoji emoji-1f641" role="img" title="frown">:frown:</span></p>



<a name="177054976"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177054976" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177054976">(Oct 01 2019 at 13:30)</a>:</h4>
<p>I guess just refreshing the cache before calling the <code>WithPredecessors</code> thing isn't an option?</p>



<a name="177055343"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177055343" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177055343">(Oct 01 2019 at 13:34)</a>:</h4>
<p>e_O I hadn't thought of that... let me see how often that's called</p>



<a name="177057383"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177057383" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177057383">(Oct 01 2019 at 13:58)</a>:</h4>
<p>Ok, that helped to move past that panic. Running into other ones now. I'll see if I can't try the same approach</p>



<a name="177057466"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177057466" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177057466">(Oct 01 2019 at 13:59)</a>:</h4>
<p>Actually, what's a little confusing to me is that the next crash is in the codegen passes. Wouldn't the final pass I added inside of optimize passes have fixed that?</p>



<a name="177058364"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177058364" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177058364">(Oct 01 2019 at 14:08)</a>:</h4>
<p>it should have fixed that indeed, do you have a backtrace?</p>



<a name="177060916"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177060916" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177060916">(Oct 01 2019 at 14:32)</a>:</h4>
<p>Yep, let's see if it's not too long for zulip (one sec while I copy paste from the terminal)</p>



<a name="177060951"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177060951" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177060951">(Oct 01 2019 at 14:32)</a>:</h4>
<div class="codehilite"><pre><span></span>thread &#39;rustc&#39; panicked at &#39;assertion failed: self.predecessors_cache.is_some()&#39;, src/librustc/mir/mod.rs:239:9
stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /home/pfaria/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.37/src/backtrace/libunwind.rs:88
   1: backtrace::backtrace::trace_unsynchronized
             at /home/pfaria/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.37/src/backtrace/mod.rs:66
   2: std::sys_common::backtrace::_print_fmt
             at src/libstd/sys_common/backtrace.rs:76
   3: &lt;std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display&gt;::fmt
             at src/libstd/sys_common/backtrace.rs:60
   4: core::fmt::write
             at src/libcore/fmt/mod.rs:1030
   5: std::io::Write::write_fmt
             at src/libstd/io/mod.rs:1412
   6: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:64
   7: std::sys_common::backtrace::print
             at src/libstd/sys_common/backtrace.rs:49
   8: std::panicking::default_hook::{{closure}}
             at src/libstd/panicking.rs:196
   9: std::panicking::default_hook
             at src/libstd/panicking.rs:210
  10: &lt;alloc::boxed::Box&lt;F&gt; as core::ops::function::Fn&lt;A&gt;&gt;::call
             at ./src/liballoc/boxed.rs:936
  11: rustc_driver::report_ice
             at src/librustc_driver/lib.rs:1188
  12: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:477
  13: std::panicking::begin_panic
             at ./src/libstd/panicking.rs:407
  14: rustc::mir::Body::unwrap_predecessors
             at ./&lt;::std::macros::panic macros&gt;:3
  15: rustc::mir::Body::predecessors_for
             at ./src/librustc/mir/mod.rs:268
  16: rustc_codegen_ssa::mir::codegen_mir
             at ./src/librustc_codegen_ssa/mir/mod.rs:210
  17: rustc_codegen_ssa::base::codegen_instance
             at ./src/librustc_codegen_ssa/base.rs:386
  18: &lt;rustc::mir::mono::MonoItem as rustc_codegen_ssa::mono_item::MonoItemExt&gt;::define
             at ./src/librustc_codegen_ssa/mono_item.rs:40
  19: rustc_codegen_llvm::base::compile_codegen_unit::module_codegen
             at src/librustc_codegen_llvm/base.rs:143
  20: rustc::dep_graph::graph::DepGraph::with_task_impl
             at ./src/librustc/dep_graph/graph.rs:334
  21: rustc::dep_graph::graph::DepGraph::with_task
             at ./src/librustc/dep_graph/graph.rs:202
  22: rustc_codegen_llvm::base::compile_codegen_unit
             at src/librustc_codegen_llvm/base.rs:110
  23: &lt;rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_ssa::traits::backend::ExtraBackendMethods&gt;::compile_codegen_unit
             at src/librustc_codegen_llvm/lib.rs:126
  24: rustc_codegen_ssa::base::codegen_crate
             at ./src/librustc_codegen_ssa/base.rs:617
  25: &lt;rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_utils::codegen_backend::CodegenBackend&gt;::codegen_crate
             at src/librustc_codegen_llvm/lib.rs:289
  26: rustc_interface::passes::start_codegen::{{closure}}
             at src/librustc_interface/passes.rs:1092
  27: rustc::util::common::time_ext
             at ./src/librustc/util/common.rs:117
  28: rustc::util::common::time
             at ./src/librustc/util/common.rs:111
  29: rustc_interface::passes::start_codegen
             at src/librustc_interface/passes.rs:1091
  30: rustc_interface::queries::&lt;impl rustc_interface::interface::Compiler&gt;::ongoing_codegen::{{closure}}::{{closure}}
             at src/librustc_interface/queries.rs:243
  31: rustc_interface::passes::BoxedGlobalCtxt::enter::{{closure}}::{{closure}}
             at src/librustc_interface/passes.rs:813
  32: rustc::ty::context::tls::enter_global::{{closure}}
             at ./src/librustc/ty/context.rs:1883
  33: rustc::ty::context::tls::enter_context::{{closure}}
             at ./src/librustc/ty/context.rs:1851
  34: rustc::ty::context::tls::set_tlv
             at ./src/librustc/ty/context.rs:1784
  35: rustc::ty::context::tls::enter_context
             at ./src/librustc/ty/context.rs:1850
  36: rustc::ty::context::tls::enter_global
             at ./src/librustc/ty/context.rs:1882
  37: rustc_interface::passes::BoxedGlobalCtxt::enter::{{closure}}
             at src/librustc_interface/passes.rs:813
  38: rustc_interface::passes::BoxedGlobalCtxt::access::{{closure}}
             at ./&lt;::rustc_data_structures::box_region::declare_box_region_type macros&gt;:22
  39: rustc_interface::passes::create_global_ctxt::{{closure}}
             at src/librustc_interface/passes.rs:879
  40: alloc::boxed::&lt;impl core::ops::generator::Generator for core::pin::Pin&lt;alloc::boxed::Box&lt;G&gt;&gt;&gt;::resume
             at ./src/liballoc/boxed.rs:1073
  41: rustc_data_structures::box_region::PinnedGenerator&lt;I,A,R&gt;::access
             at ./src/librustc_data_structures/box_region.rs:52
  42: rustc_interface::passes::BoxedGlobalCtxt::access
             at ./&lt;::rustc_data_structures::box_region::declare_box_region_type macros&gt;:25
  43: rustc_interface::passes::BoxedGlobalCtxt::enter
             at src/librustc_interface/passes.rs:813
  44: rustc_interface::queries::&lt;impl rustc_interface::interface::Compiler&gt;::ongoing_codegen::{{closure}}
             at src/librustc_interface/queries.rs:237
  45: rustc_interface::queries::Query&lt;T&gt;::compute
             at src/librustc_interface/queries.rs:28
  46: rustc_interface::queries::&lt;impl rustc_interface::interface::Compiler&gt;::ongoing_codegen
             at src/librustc_interface/queries.rs:234
  47: rustc_driver::run_compiler::{{closure}}
             at src/librustc_driver/lib.rs:388
  48: rustc_interface::interface::run_compiler_in_existing_thread_pool
             at ./src/librustc_interface/interface.rs:122
  49: rustc_interface::interface::run_compiler::{{closure}}
             at ./src/librustc_interface/interface.rs:141
  50: rustc_interface::util::spawn_thread_pool::{{closure}}::{{closure}}::{{closure}}::{{closure}}
             at ./src/librustc_interface/util.rs:192
  51: rustc::ty::context::tls::with_thread_locals::{{closure}}::{{closure}}
             at ./src/librustc/ty/context.rs:1839
  52: std::thread::local::LocalKey&lt;T&gt;::try_with
             at ./src/libstd/thread/local.rs:262
  53: std::thread::local::LocalKey&lt;T&gt;::with
             at ./src/libstd/thread/local.rs:239
  54: rustc::ty::context::tls::with_thread_locals::{{closure}}
             at ./src/librustc/ty/context.rs:1831
  55: std::thread::local::LocalKey&lt;T&gt;::try_with
             at ./src/libstd/thread/local.rs:262
  56: std::thread::local::LocalKey&lt;T&gt;::with
             at ./src/libstd/thread/local.rs:239
  57: rustc::ty::context::tls::with_thread_locals
             at ./src/librustc/ty/context.rs:1823
  58: rustc_interface::util::spawn_thread_pool::{{closure}}::{{closure}}::{{closure}}
             at ./src/librustc_interface/util.rs:192
  59: scoped_tls::ScopedKey&lt;T&gt;::set
             at /home/pfaria/.cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-1.0.0/src/lib.rs:137
  60: rustc_interface::util::spawn_thread_pool::{{closure}}::{{closure}}
             at ./src/librustc_interface/util.rs:188
  61: scoped_tls::ScopedKey&lt;T&gt;::set
             at /home/pfaria/.cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-1.0.0/src/lib.rs:137
  62: syntax::with_globals::{{closure}}
             at ./src/libsyntax/lib.rs:109
  63: scoped_tls::ScopedKey&lt;T&gt;::set
             at /home/pfaria/.cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-1.0.0/src/lib.rs:137
  64: syntax::with_globals
             at ./src/libsyntax/lib.rs:108
  65: rustc_interface::util::spawn_thread_pool::{{closure}}
             at ./src/librustc_interface/util.rs:187
  66: rustc_interface::util::scoped_thread::{{closure}}
             at ./src/librustc_interface/util.rs:164
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
</pre></div>



<a name="177062216"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177062216" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177062216">(Oct 01 2019 at 14:46)</a>:</h4>
<p>Oh. I think this is because the value comes from <code>instance_mir</code>, which may be an autogenerated MIR and not one that passed through <code>optimized_mir</code></p>



<a name="177062961"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177062961" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177062961">(Oct 01 2019 at 14:54)</a>:</h4>
<p>Is that one generated with passes in a similar manner? Where I should add the predecessors pass at the end of that one as well?</p>



<a name="177062962"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177062962" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177062962">(Oct 01 2019 at 14:54)</a>:</h4>
<p>Or is it generated differently?</p>



<a name="177063404"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177063404" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177063404">(Oct 01 2019 at 14:58)</a>:</h4>
<p>you should be able to add your pass to <a href="https://github.com/rust-lang/rust/blob/22bc9e1d9ca49ee4f5cd953088ab09c238a6dd26/src/librustc_mir/shim.rs#L115" target="_blank" title="https://github.com/rust-lang/rust/blob/22bc9e1d9ca49ee4f5cd953088ab09c238a6dd26/src/librustc_mir/shim.rs#L115">https://github.com/rust-lang/rust/blob/22bc9e1d9ca49ee4f5cd953088ab09c238a6dd26/src/librustc_mir/shim.rs#L115</a></p>



<a name="177064742"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177064742" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177064742">(Oct 01 2019 at 15:12)</a>:</h4>
<p>That didn't seem to work. I tried adding a log to the pass, but I can't seem to get it to emit</p>



<a name="177064772"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177064772" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177064772">(Oct 01 2019 at 15:12)</a>:</h4>
<p>Is the env variable <code>RUST_LOG=librustc_mir=debug</code>? Or is it different when running in the compiler?</p>



<a name="177065320"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177065320" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177065320">(Oct 01 2019 at 15:18)</a>:</h4>
<p>I think you need <code>RUSTC_LOG</code></p>



<a name="177065735"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177065735" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177065735">(Oct 01 2019 at 15:22)</a>:</h4>
<p>It also helps if I ask for <code>librustc_mir</code> rather than <code>lubrustc_mir</code> <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="177065753"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177065753" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177065753">(Oct 01 2019 at 15:22)</a>:</h4>
<p>ha</p>



<a name="177065766"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177065766" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177065766">(Oct 01 2019 at 15:23)</a>:</h4>
<p><code>lobster_mir</code></p>



<a name="177065784"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177065784" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177065784">(Oct 01 2019 at 15:23)</a>:</h4>
<p>we should name our crates for rustaceans</p>



<a name="177066374"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177066374" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177066374">(Oct 01 2019 at 15:29)</a>:</h4>
<blockquote>
<p><code>lobster_mir</code></p>
</blockquote>
<p>I'm going to register that into <a href="http://crates.io" target="_blank" title="http://crates.io">crates.io</a> right now</p>



<a name="177117341"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177117341" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177117341">(Oct 02 2019 at 02:55)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span>  I just got around to trying the changes out. Adding the pass in the shim didn't seem to make a difference. I added it at the end. Should it be done earlier? Also, here's a snippet of the logs I collected:</p>
<div class="codehilite"><pre><span></span>thread &#39;rustc&#39; panicked at &#39;Expected predecessors_cache to be `Some(...)` at: /home/pfaria/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.37/src/types.rs:19:5: 19:20&#39;, src/librustc/mir/mod.rs:241:9
stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at ./src/backtrace/libunwind.rs:88
   1: backtrace::backtrace::trace_unsynchronized
             at ./src/backtrace/mod.rs:66
   2: std::sys_common::backtrace::_print_fmt
             at src/libstd/sys_common/backtrace.rs:76
   3: &lt;std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display&gt;::fmt
             at src/libstd/sys_common/backtrace.rs:60
   4: core::fmt::write
             at src/libcore/fmt/mod.rs:1030
   5: std::io::Write::write_fmt
             at src/libstd/io/mod.rs:1412
   6: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:64
   7: std::sys_common::backtrace::print
             at src/libstd/sys_common/backtrace.rs:49
   8: std::panicking::default_hook::{{closure}}
             at src/libstd/panicking.rs:196
   9: std::panicking::default_hook
             at src/libstd/panicking.rs:210
  10: &lt;alloc::boxed::Box&lt;F&gt; as core::ops::function::Fn&lt;A&gt;&gt;::call
             at /home/pfaria/projects/rust/src/liballoc/boxed.rs:936
  11: rustc_driver::report_ice
             at src/librustc_driver/lib.rs:1188
  12: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:477
  13: std::panicking::continue_panic_fmt
             at src/libstd/panicking.rs:380
  14: std::panicking::begin_panic_fmt
             at src/libstd/panicking.rs:335
  15: rustc::mir::Body::unwrap_predecessors
             at /home/pfaria/projects/rust/&lt;::std::macros::panic macros&gt;:9
  16: rustc::mir::Body::predecessors_for
             at /home/pfaria/projects/rust/src/librustc/mir/mod.rs:271
  17: rustc_codegen_ssa::mir::codegen_mir
             at /home/pfaria/projects/rust/src/librustc_codegen_ssa/mir/mod.rs:210
  18: rustc_codegen_ssa::base::codegen_instance
             at /home/pfaria/projects/rust/src/librustc_codegen_ssa/base.rs:386
  19: &lt;rustc::mir::mono::MonoItem as rustc_codegen_ssa::mono_item::MonoItemExt&gt;::define
             at /home/pfaria/projects/rust/src/librustc_codegen_ssa/mono_item.rs:40
  20: rustc_codegen_llvm::base::compile_codegen_unit::module_codegen
             at src/librustc_codegen_llvm/base.rs:143
  21: rustc::dep_graph::graph::DepGraph::with_task_impl
             at /home/pfaria/projects/rust/src/librustc/dep_graph/graph.rs:334
  22: rustc::dep_graph::graph::DepGraph::with_task
             at /home/pfaria/projects/rust/src/librustc/dep_graph/graph.rs:202
  23: rustc_codegen_llvm::base::compile_codegen_unit
             at src/librustc_codegen_llvm/base.rs:110
  24: &lt;rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_ssa::traits::backend::ExtraBackendMethods&gt;::compile_codegen_unit
             at src/librustc_codegen_llvm/lib.rs:126
  25: rustc_codegen_ssa::base::codegen_crate
             at /home/pfaria/projects/rust/src/librustc_codegen_ssa/base.rs:617
  26: &lt;rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_utils::codegen_backend::CodegenBackend&gt;::codegen_crate
             at src/librustc_codegen_llvm/lib.rs:289
  27: rustc_interface::passes::start_codegen::{{closure}}
             at src/librustc_interface/passes.rs:1092
  28: rustc::util::common::time_ext
             at /home/pfaria/projects/rust/src/librustc/util/common.rs:117
  29: rustc::util::common::time
             at /home/pfaria/projects/rust/src/librustc/util/common.rs:111
  30: rustc_interface::passes::start_codegen
             at src/librustc_interface/passes.rs:1091
  31: rustc_interface::queries::&lt;impl rustc_interface::interface::Compiler&gt;::ongoing_codegen::{{closure}}::{{closure}}
             at src/librustc_interface/queries.rs:243
  32: rustc_interface::passes::BoxedGlobalCtxt::enter::{{closure}}::{{closure}}
             at src/librustc_interface/passes.rs:813
  33: rustc::ty::context::tls::enter_global::{{closure}}
             at /home/pfaria/projects/rust/src/librustc/ty/context.rs:1883
  34: rustc::ty::context::tls::enter_context::{{closure}}
             at /home/pfaria/projects/rust/src/librustc/ty/context.rs:1851
  35: rustc::ty::context::tls::set_tlv
             at /home/pfaria/projects/rust/src/librustc/ty/context.rs:1784
  36: rustc::ty::context::tls::enter_context
             at /home/pfaria/projects/rust/src/librustc/ty/context.rs:1850
  37: rustc::ty::context::tls::enter_global
             at /home/pfaria/projects/rust/src/librustc/ty/context.rs:1882
  38: rustc_interface::passes::BoxedGlobalCtxt::enter::{{closure}}
             at src/librustc_interface/passes.rs:813
  39: rustc_interface::passes::BoxedGlobalCtxt::access::{{closure}}
             at /home/pfaria/projects/rust/&lt;::rustc_data_structures::box_region::declare_box_region_type macros&gt;:22
  40: rustc_interface::passes::create_global_ctxt::{{closure}}
             at src/librustc_interface/passes.rs:879
  41: alloc::boxed::&lt;impl core::ops::generator::Generator for core::pin::Pin&lt;alloc::boxed::Box&lt;G&gt;&gt;&gt;::resume
             at /home/pfaria/projects/rust/src/liballoc/boxed.rs:1073
  42: rustc_data_structures::box_region::PinnedGenerator&lt;I,A,R&gt;::access
             at /home/pfaria/projects/rust/src/librustc_data_structures/box_region.rs:52
  43: rustc_interface::passes::BoxedGlobalCtxt::access
             at /home/pfaria/projects/rust/&lt;::rustc_data_structures::box_region::declare_box_region_type macros&gt;:25
  44: rustc_interface::passes::BoxedGlobalCtxt::enter
             at src/librustc_interface/passes.rs:813
  45: rustc_interface::queries::&lt;impl rustc_interface::interface::Compiler&gt;::ongoing_codegen::{{closure}}
             at src/librustc_interface/queries.rs:237
  46: rustc_interface::queries::Query&lt;T&gt;::compute
             at src/librustc_interface/queries.rs:28
  47: rustc_interface::queries::&lt;impl rustc_interface::interface::Compiler&gt;::ongoing_codegen
             at src/librustc_interface/queries.rs:234
  48: rustc_driver::run_compiler::{{closure}}
             at src/librustc_driver/lib.rs:388
  49: rustc_interface::interface::run_compiler_in_existing_thread_pool
             at /home/pfaria/projects/rust/src/librustc_interface/interface.rs:122
  50: rustc_interface::interface::run_compiler::{{closure}}
             at /home/pfaria/projects/rust/src/librustc_interface/interface.rs:141
  51: rustc_interface::util::spawn_thread_pool::{{closure}}::{{closure}}::{{closure}}::{{closure}}
             at /home/pfaria/projects/rust/src/librustc_interface/util.rs:192
  52: rustc::ty::context::tls::with_thread_locals::{{closure}}::{{closure}}
             at /home/pfaria/projects/rust/src/librustc/ty/context.rs:1839
  53: std::thread::local::LocalKey&lt;T&gt;::try_with
             at /home/pfaria/projects/rust/src/libstd/thread/local.rs:262
  54: std::thread::local::LocalKey&lt;T&gt;::with
             at /home/pfaria/projects/rust/src/libstd/thread/local.rs:239
  55: rustc::ty::context::tls::with_thread_locals::{{closure}}
             at /home/pfaria/projects/rust/src/librustc/ty/context.rs:1831
  56: std::thread::local::LocalKey&lt;T&gt;::try_with
             at /home/pfaria/projects/rust/src/libstd/thread/local.rs:262
  57: std::thread::local::LocalKey&lt;T&gt;::with
             at /home/pfaria/projects/rust/src/libstd/thread/local.rs:239
  58: rustc::ty::context::tls::with_thread_locals
             at /home/pfaria/projects/rust/src/librustc/ty/context.rs:1823
  59: rustc_interface::util::spawn_thread_pool::{{closure}}::{{closure}}::{{closure}}
             at /home/pfaria/projects/rust/src/librustc_interface/util.rs:192
  60: scoped_tls::ScopedKey&lt;T&gt;::set
             at /home/pfaria/.cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-1.0.0/src/lib.rs:137
  61: rustc_interface::util::spawn_thread_pool::{{closure}}::{{closure}}
             at /home/pfaria/projects/rust/src/librustc_interface/util.rs:188
  62: scoped_tls::ScopedKey&lt;T&gt;::set
             at /home/pfaria/.cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-1.0.0/src/lib.rs:137
  63: syntax::with_globals::{{closure}}
             at /home/pfaria/projects/rust/src/libsyntax/lib.rs:109
  64: scoped_tls::ScopedKey&lt;T&gt;::set
             at /home/pfaria/.cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-1.0.0/src/lib.rs:137
  65: syntax::with_globals
             at /home/pfaria/projects/rust/src/libsyntax/lib.rs:108
  66: rustc_interface::util::spawn_thread_pool::{{closure}}
             at /home/pfaria/projects/rust/src/librustc_interface/util.rs:187
  67: rustc_interface::util::scoped_thread::{{closure}}
             at /home/pfaria/projects/rust/src/librustc_interface/util.rs:164
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
</pre></div>



<a name="177117349"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177117349" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177117349">(Oct 02 2019 at 02:55)</a>:</h4>
<p>And the logs I had from before that:</p>
<div class="codehilite"><pre><span></span>[DEBUG rustc::mir] PAUL: Recomputing predecessors: /home/pfaria/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.37/src/types.rs:16:10: 16:15
[DEBUG rustc::mir] PAUL: Invalidating through opt terminator: /home/pfaria/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.37/src/types.rs:16:10: 16:15
[DEBUG rustc::mir] PAUL: Invalidating through opt terminator: /home/pfaria/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.37/src/types.rs:16:10: 16:15
[DEBUG rustc::mir] PAUL: Invalidating through opt terminator: /home/pfaria/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.37/src/types.rs:16:10: 16:15
[DEBUG rustc::mir] PAUL: Invalidating through opt terminator: /home/pfaria/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.37/src/types.rs:16:10: 16:15
[DEBUG rustc::mir] PAUL: Invalidating through opt terminator: /home/pfaria/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.37/src/types.rs:16:10: 16:15
[DEBUG rustc::mir] PAUL: Invalidating through opt terminator: /home/pfaria/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.37/src/types.rs:16:10: 16:15
[DEBUG rustc::mir] PAUL: Invalidating through opt terminator: /home/pfaria/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.37/src/types.rs:16:10: 16:15
[DEBUG rustc::mir] PAUL: Invalidating through opt terminator: /home/pfaria/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.37/src/types.rs:16:10: 16:15
[DEBUG rustc::mir] PAUL: Invalidating through opt terminator: /home/pfaria/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.37/src/types.rs:16:10: 16:15
[DEBUG rustc::mir] PAUL: Invalidating through opt terminator: /home/pfaria/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.37/src/types.rs:16:10: 16:15
[DEBUG rustc::mir] PAUL: Invalidating through opt terminator: /home/pfaria/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.37/src/types.rs:16:10: 16:15
[DEBUG rustc_mir::transform::ensure_predecessors_cache] before-opt-dump: Ensure predecessors cache: /home/pfaria/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.37/src/types.rs:16:10: 16:15
[DEBUG rustc::mir] PAUL: Recomputing predecessors: /home/pfaria/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.37/src/types.rs:16:10: 16:15
...
</pre></div>



<a name="177117424"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177117424" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177117424">(Oct 02 2019 at 02:56)</a>:</h4>
<p>So it seems to be processing the <code>backtrace</code> crate (I doubt this is important), but the crash occurs when looking at the body for <code>types.rs:19:5: 19:20</code>, which is never logged at any point previously during compilation (so no cache computing, not invalidation attempts)</p>



<a name="177118033"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177118033" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177118033">(Oct 02 2019 at 03:12)</a>:</h4>
<p>I have the full trace as well, if that would help, but it's ~27,000 lines  long and includes a lot of extra logs. I couldn't figure out how to filter to only log at the <code>rustc::mir</code> level and nothing below that</p>



<a name="177124516"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177124516" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177124516">(Oct 02 2019 at 06:17)</a>:</h4>
<p>maybe there's another way <code>instance_mir</code> can generate MIR that I haven't seen? Try following all the function calls in <code>instance_mir</code> and below</p>



<a name="177146424"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177146424" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177146424">(Oct 02 2019 at 12:54)</a>:</h4>
<p>Oooh, Looks like there might be a special case for tuple struct constructors. Compiling an attempt now</p>



<a name="177148253"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177148253" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177148253">(Oct 02 2019 at 13:16)</a>:</h4>
<p>Ok, got past that panic, on to the next few. I'll review the next ones after work. Thanks again!</p>



<a name="177148713"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177148713" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177148713">(Oct 02 2019 at 13:21)</a>:</h4>
<p>:D whack-a-panic</p>



<a name="177212731"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177212731" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177212731">(Oct 03 2019 at 03:51)</a>:</h4>
<p>@oli: It can finally compile the compiler :). In my analysis I realized the terminator_mut method idea I had gets called a LOT, so I'd like to do a comparison between that and the previous one (I think I might have messed up your earlier instructions about splitting up the PR, this PR include a different cache invalidation strategy). The latest commit is as small as I thought I could make it</p>



<a name="177310142"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177310142" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177310142">(Oct 04 2019 at 04:40)</a>:</h4>
<p>I addressed a lot of the issues in the draft PR. I'm rolling back the changes that made terminator invalidate, but I'm seeing that the cache is invalidated more frequently now, so there are additional panics I'm working through. Going to follow up tomorrow morning</p>



<a name="177333880"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177333880" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177333880">(Oct 04 2019 at 12:34)</a>:</h4>
<p>Nice</p>



<a name="177340095"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177340095" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177340095">(Oct 04 2019 at 13:47)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> I addressed the additional comments you had. For some reason I cannot comment on or resolve the comment you left on <code>src/librustc_mir/transform/add_call_guards.rs Outdated</code>.  I think for this first pass the only remaining item to address is how to manage the serialization of that field (it's the comment midway through the PR from last week).</p>



<a name="177340592"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177340592" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177340592">(Oct 04 2019 at 13:52)</a>:</h4>
<p>Also, would it make sense to move it out of draft at this point?</p>



<a name="177563310"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177563310" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177563310">(Oct 07 2019 at 21:36)</a>:</h4>
<p>I added the cache class back so we can ensure there's no encoding/decoding of the cache going on. This broke a few more things. However, now that the compiler is passing, a bunch of tests are panicking. I'll try to address those as well. It does feel a bit scary though that I can't easily predict where the next panic will come from.</p>



<a name="177598307"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177598307" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177598307">(Oct 08 2019 at 09:49)</a>:</h4>
<p>that's super odd. I thought all the uses of the cache were in the same crate and not cross crate</p>



<a name="177602337"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177602337" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177602337">(Oct 08 2019 at 10:55)</a>:</h4>
<p>It was breaking on things like <code>num::wrapping_add</code> and <code>array... Something</code>. They were both generated by macro calls I think. I'll follow up when I get back to my computer</p>



<a name="177608684"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177608684" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177608684">(Oct 08 2019 at 12:36)</a>:</h4>
<p>Not sure why I put macros there. I shouldn't message immediately after waking up... It was getting the result from <code>instance_mir</code>, and there from <code>optimized_mir</code>. But I wasn't sure which impl it was calling because there are two in the compiler.. The weirdest part was that neither impl would log in the case of the panic, but they would in other instances.</p>



<a name="177609130"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177609130" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177609130">(Oct 08 2019 at 12:41)</a>:</h4>
<p>I might have also been jumping to conclusions about the encoding/decoding part. That was just the one part that would make sense given the only change at the time was the move back to the cache with the encoding/decoding changes.</p>



<a name="177609579"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177609579" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177609579">(Oct 08 2019 at 12:47)</a>:</h4>
<p>Also, inside of <code>instance_mir</code>, which <code>optimized_mir</code> is getting called? Is it <a href="https://github.com/rust-lang/rust/blob/e3cb9ea15a2082f39d4d4f10a22e779701dd0d64/src/librustc_metadata/cstore_impl.rs#L129" target="_blank" title="https://github.com/rust-lang/rust/blob/e3cb9ea15a2082f39d4d4f10a22e779701dd0d64/src/librustc_metadata/cstore_impl.rs#L129">https://github.com/rust-lang/rust/blob/e3cb9ea15a2082f39d4d4f10a22e779701dd0d64/src/librustc_metadata/cstore_impl.rs#L129</a> or <a href="https://github.com/rust-lang/rust/blob/22bc9e1d9ca49ee4f5cd953088ab09c238a6dd26/src/librustc_mir/transform/mod.rs#L282" target="_blank" title="https://github.com/rust-lang/rust/blob/22bc9e1d9ca49ee4f5cd953088ab09c238a6dd26/src/librustc_mir/transform/mod.rs#L282">https://github.com/rust-lang/rust/blob/22bc9e1d9ca49ee4f5cd953088ab09c238a6dd26/src/librustc_mir/transform/mod.rs#L282</a> ?</p>



<a name="177609681"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177609681" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177609681">(Oct 08 2019 at 12:48)</a>:</h4>
<p>the latter, but the latter may call the former</p>



<a name="177609683"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177609683" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177609683">(Oct 08 2019 at 12:48)</a>:</h4>
<p>I had logs at the beginning of both of those calls, as well as surrounding the call in <code>instance_mir</code>. Specifically in the case of the panic, the logs in the <code>optimized_mir</code> fns wouldn't be output, but the surrounding ones in <code>instance_mir</code> would... which I couldn't wrap my head around</p>



<a name="177609695"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177609695" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177609695">(Oct 08 2019 at 12:48)</a>:</h4>
<p>well</p>



<a name="177609696"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177609696" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177609696">(Oct 08 2019 at 12:48)</a>:</h4>
<p>not quite</p>



<a name="177609698"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177609698" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177609698">(Oct 08 2019 at 12:48)</a>:</h4>
<p>sorry</p>



<a name="177609701"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177609701" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177609701">(Oct 08 2019 at 12:48)</a>:</h4>
<p>I could find instances of the calls throughout the rest of the log, but not in that specific instance</p>



<a name="177609704"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177609704" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177609704">(Oct 08 2019 at 12:48)</a>:</h4>
<p>so</p>



<a name="177609707"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177609707" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177609707">(Oct 08 2019 at 12:48)</a>:</h4>
<p>this is a query</p>



<a name="177609725"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177609725" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177609725">(Oct 08 2019 at 12:48)</a>:</h4>
<p>Oh, is it memoized?</p>



<a name="177610053"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177610053" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177610053">(Oct 08 2019 at 12:52)</a>:</h4>
<p>Oh... I just found <a href="https://github.com/rust-lang/rust/blob/9e35a2811d8c65e9473176b8656a3201b7e152c7/src/librustc/query/mod.rs#L123" target="_blank" title="https://github.com/rust-lang/rust/blob/9e35a2811d8c65e9473176b8656a3201b7e152c7/src/librustc/query/mod.rs#L123">https://github.com/rust-lang/rust/blob/9e35a2811d8c65e9473176b8656a3201b7e152c7/src/librustc/query/mod.rs#L123</a></p>



<a name="177610093"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177610093" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177610093">(Oct 08 2019 at 12:53)</a>:</h4>
<p>That's only part of it</p>



<a name="177610125"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177610125" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177610125">(Oct 08 2019 at 12:53)</a>:</h4>
<p>I can't find the place where the swtich on <code>def_id.is_local()</code> happens and decides on whether a query is run or fetched from the store</p>



<a name="177610130"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177610130" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177610130">(Oct 08 2019 at 12:54)</a>:</h4>
<p>memoization is just a part of it</p>



<a name="177610187"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177610187" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177610187">(Oct 08 2019 at 12:54)</a>:</h4>
<p>if you query something from another crate, its value is loaded from metadata</p>



<a name="177610554"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177610554" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177610554">(Oct 08 2019 at 12:57)</a>:</h4>
<p>Is that not <a href="https://github.com/rust-lang/rust/blob/9e35a2811d8c65e9473176b8656a3201b7e152c7/src/librustc/query/mod.rs#L124" target="_blank" title="https://github.com/rust-lang/rust/blob/9e35a2811d8c65e9473176b8656a3201b7e152c7/src/librustc/query/mod.rs#L124">https://github.com/rust-lang/rust/blob/9e35a2811d8c65e9473176b8656a3201b7e152c7/src/librustc/query/mod.rs#L124</a> ?</p>



<a name="177610975"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177610975" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177610975">(Oct 08 2019 at 13:01)</a>:</h4>
<p>That decides to cache it, but I'm wondering what code decides where to load it from</p>



<a name="177611107"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177611107" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177611107">(Oct 08 2019 at 13:03)</a>:</h4>
<p>Following the proc macros I came to this: <a href="https://github.com/rust-lang/rust/blob/9e35a2811d8c65e9473176b8656a3201b7e152c7/src/librustc_macros/src/query.rs#L331-L353" target="_blank" title="https://github.com/rust-lang/rust/blob/9e35a2811d8c65e9473176b8656a3201b7e152c7/src/librustc_macros/src/query.rs#L331-L353">https://github.com/rust-lang/rust/blob/9e35a2811d8c65e9473176b8656a3201b7e152c7/src/librustc_macros/src/query.rs#L331-L353</a></p>



<a name="177611135"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177611135" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177611135">(Oct 08 2019 at 13:03)</a>:</h4>
<p>But having a hard to trying to map all of that in my head between the various invocations (coffee hasn't kicked in yet)</p>



<a name="177611153"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177611153" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177611153">(Oct 08 2019 at 13:03)</a>:</h4>
<p>I'm not going to have time this morning either. Need to rush to an appointment.</p>



<a name="177611221"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177611221" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177611221">(Oct 08 2019 at 13:04)</a>:</h4>
<p>Now that I know there was a third fn to look at though, I know I can follow up on this tonight and it will make my head hurt less :)</p>



<a name="177611477"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177611477" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177611477">(Oct 08 2019 at 13:07)</a>:</h4>
<p>heh</p>



<a name="177611506"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177611506" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177611506">(Oct 08 2019 at 13:07)</a>:</h4>
<p>I wouldn't worry about it too much, the query system can be used without understanding</p>



<a name="177611555"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177611555" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177611555">(Oct 08 2019 at 13:08)</a>:</h4>
<p>I understood it mostly half a year ago, but it got refactored a lot</p>



<a name="177611582"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177611582" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177611582">(Oct 08 2019 at 13:08)</a>:</h4>
<p>since I'm not doing anything in it I don't expect to get back to understanding any time soon</p>



<a name="177617595"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177617595" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177617595">(Oct 08 2019 at 14:04)</a>:</h4>
<p>Crazy thought on the way to my appointment: what if instead of storing the cache in <code>Body</code>, it was passed with it? Or if there was another struct that contained both <code>Body</code> and <code>Cache</code>?</p>



<a name="177617830"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177617830" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177617830">(Oct 08 2019 at 14:06)</a>:</h4>
<p>We could keep the cache mut while the body stays sharable, and that means it could recompute just like before</p>



<a name="177618861"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177618861" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177618861">(Oct 08 2019 at 14:14)</a>:</h4>
<p>well, you can always create an <code>eval_always</code> query that calls <code>optimized_mir</code> and computes the cache</p>



<a name="177618871"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177618871" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177618871">(Oct 08 2019 at 14:14)</a>:</h4>
<p>but that won't work inside the mir pass pipeline</p>



<a name="177618905"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177618905" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177618905">(Oct 08 2019 at 14:14)</a>:</h4>
<p>and it would then be rather hard to enforce clearing of the cache in the pipeline</p>



<a name="177618928"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177618928" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177618928">(Oct 08 2019 at 14:14)</a>:</h4>
<p>maybe it would be ok to just always eagerly compute it in the pipeline?</p>



<a name="177618947"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177618947" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177618947">(Oct 08 2019 at 14:14)</a>:</h4>
<p>is it ever actually used from a cached version?</p>



<a name="177623046"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177623046" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177623046">(Oct 08 2019 at 14:47)</a>:</h4>
<p>It did panic when it wasn't available for <code>num::wrapping_add</code></p>



<a name="177624894"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177624894" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177624894">(Oct 08 2019 at 15:05)</a>:</h4>
<p>during compilation of libcore?</p>



<a name="177671593"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177671593" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177671593">(Oct 09 2019 at 00:17)</a>:</h4>
<p>I'm actually not sure during which crate. I'll have to recreate the scenario</p>



<a name="177675759"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177675759" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177675759">(Oct 09 2019 at 01:58)</a>:</h4>
<p>Looks like the panics came from compiling <code>compiler_builtins</code>:</p>
<div class="codehilite"><pre><span></span>1947420:[INFO  rustc::ty] PAUL: Getting Item(DefId(2:13848 ~ core[9364]::num[0]::{{impl}}[8]::wrapping_add[0])) for &quot;compiler_builtins&quot;
1947421:thread &#39;rustc&#39; panicked at &#39;Expected cache.predecessors to be `Some(...)` for block at: /home/pfaria/projects/rust/src/libcore/num/mod.rs:1117:13: 1119:14&#39;, src/librustc/mir/mod.rs:230:9
1947422-stack backtrace:
1947423-   0: backtrace::backtrace::libunwind::trace
</pre></div>



<a name="177710938"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177710938" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177710938">(Oct 09 2019 at 13:01)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span>  so I've been playing with that idea of inverting the relationship: <code>OwnedCache { cache: Cache, body: Body }</code>, and it seems to work pretty well so far (I haven't gotten it completely compiling yet, I'll see if I can wrap that up tonight at the lower levels to make sure the borrowing is agreeable with the compiler). I moved the predecessor methods there as well as the methods on <code>Body</code> that invalidate the cache.</p>



<a name="177776026"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177776026" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177776026">(Oct 10 2019 at 03:26)</a>:</h4>
<p>So I actually got a good amount compiling at this point. <code>librustc</code> and <code>librustc_data_structures</code> are both compiling, but right now I'm looking at 75 errors from old fn's I removed plus the new changes that need to be accounted for. Could you review the progress I made so far and let me know if anything stands out as <code>this clearly won't work</code>? I also wasn't sure if those wrapper types helped at all, but it did make writing the visitor macro significantly easier. It also helps ensure that <code>Body</code> can't be mutated when <code>BorrowedCache</code> is being passed around, but that the cache can still be populated if needed (removing the need for us to sprinkle <code>ensure_predecessors</code> everywhere.</p>



<a name="177776090"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/177776090" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#177776090">(Oct 10 2019 at 03:28)</a>:</h4>
<p>Also, regarding the <code>WithPredecessors::predecessors(&amp;mut self)</code> trait fn, I couldn't find a way to write it with <code>self</code>. There were lots of issues with it wanting to consume the <code>&amp;mut</code> and only being satisfied if the <code>T</code> of <code>&amp;mut T</code> was also <code>Copy</code>, which isn't possible since <code>&amp;mut</code> types can't be <code>Copy</code>.</p>



<a name="178075398"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/178075398" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#178075398">(Oct 14 2019 at 05:50)</a>:</h4>
<p>Cleaned up the passthrough nightmare. I finally figured out the lifetime issues. librustc_codegen_ssa should be good at this point. Going to try tackling librustc_mir during the week. Given that I have 181 errors in that crate, I'm expecting it to take a while to get through all of them.</p>



<a name="178559166"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/178559166" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#178559166">(Oct 19 2019 at 19:12)</a>:</h4>
<p>Got really busy with personal stuff this week. Rebased recently and I need to redo codegen_ssa again <span aria-label="sob" class="emoji emoji-1f62d" role="img" title="sob">:sob:</span>. Someone built a helper that checks predecessors and now I need to get <code>&amp;mut BodyCache&lt;...&gt;</code> through all the modules. Might have time to look at that later tonight or tomorrow afternoon for a few hours.</p>



<a name="178818256"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/178818256" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#178818256">(Oct 23 2019 at 02:46)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span>  I've been working through the idea you posted a few days ago on the PR.</p>



<a name="178818402"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/178818402" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#178818402">(Oct 23 2019 at 02:51)</a>:</h4>
<p>I had to ensure the <code>BodyCache</code> returned a new type <code>ReadOnlyBodyCache</code> that ensures the cache is computed before it can be created. This is necessary to fulfill the usage within dominators, which requires the <code>Cache</code> and the <code>Body</code> (and it's not possible to implement the traits against tuples). The issue I'm running into is that to create <code>ReadOnlyBodyCache</code>, I need an fn like:</p>
<div class="codehilite"><pre><span></span><span class="k">fn</span> <span class="nf">read_only</span><span class="p">(</span><span class="o">&amp;</span><span class="na">&#39;b</span><span class="w"> </span><span class="k">mut</span><span class="w"> </span><span class="bp">self</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="nc">ReadOnlyBodyCache</span><span class="o">&lt;</span><span class="na">&#39;b</span><span class="p">,</span><span class="w"> </span><span class="na">&#39;tcx</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">  </span><span class="bp">self</span><span class="p">.</span><span class="n">ensure_predecessors</span><span class="p">();</span><span class="w"></span>
<span class="w">  </span><span class="n">ReadOnlyBodyCache</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="n">cache</span>: <span class="kp">&amp;</span><span class="nc">self</span><span class="p">.</span><span class="n">cache</span><span class="p">,</span><span class="w"></span>
<span class="w">    </span><span class="n">body</span>: <span class="nc">self</span><span class="p">.</span><span class="n">body</span><span class="p">,</span><span class="w"></span>
<span class="w">  </span><span class="p">}</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>


<p>However, this restricts <code>self</code> from being borrowed immutably elsewhere because the mutable borrow is held. How would I work around this? Would it be alright to make <code>ensure_predecessors</code> public, and generating <code>ReadOnlyBodyCache</code> will just panic if the cache isn't computed?</p>



<a name="178818479"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/178818479" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#178818479">(Oct 23 2019 at 02:54)</a>:</h4>
<p>Would it make sense to wrap something like that in a macro to make the <code>ensure_predecessors</code> call pseudo-private?</p>



<a name="178849118"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/178849118" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#178849118">(Oct 23 2019 at 12:40)</a>:</h4>
<p>you could make it a method that takes <code>self</code> by value. To go back to a mutable version you can create a second method to convert back</p>



<a name="178856366"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/178856366" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#178856366">(Oct 23 2019 at 14:02)</a>:</h4>
<p>Oh I hadn't thought about converting back. That should work. Thanks!</p>



<a name="179052142"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/179052142" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#179052142">(Oct 25 2019 at 14:04)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span>  when you get a chance, I've fixed all the type errors up to <code>librustc_mir/transform</code>. What's the best place for me to get started on allowing the <code>MirPass</code>es to pass along the caches? I'm also wondering what to do about the fact that some will need to take <code>&amp;mut BodyCache&lt;&amp;'a mut Body&lt;'tcx&gt;&gt;</code>, and some will need <code>ReadOnlyBodyCache&lt;'a, 'tcx&gt;</code>.</p>



<a name="179052175"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/179052175" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#179052175">(Oct 25 2019 at 14:04)</a>:</h4>
<p>That last bit is regarding the <code>run_pass</code> fn</p>



<a name="179052201"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/179052201" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#179052201">(Oct 25 2019 at 14:05)</a>:</h4>
<p>Hmmm maybe passing around a <code>&amp;mut BodyCache&lt;Body&lt;'tcx&gt;&gt;</code>?</p>



<a name="179052214"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/179052214" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#179052214">(Oct 25 2019 at 14:05)</a>:</h4>
<p>And then converting that to the other types as needed?</p>



<a name="179053830"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/179053830" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#179053830">(Oct 25 2019 at 14:23)</a>:</h4>
<p>can't all <code>MirPass</code>es take <code>&amp;mut BodyCache</code>?</p>



<a name="179054678"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/179054678" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#179054678">(Oct 25 2019 at 14:34)</a>:</h4>
<p>They could, but then I'm not sure whether to pass around <code>&amp;mut BodyCache&lt;Body&lt;'tcx&gt;&gt;</code> or <code>&amp;mut BodyCache&lt;&amp;'a mut Body&lt;'tcx&gt;&gt;</code></p>



<a name="179054717"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/179054717" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#179054717">(Oct 25 2019 at 14:34)</a>:</h4>
<p>I assume the latter will give me issues with returning <code>&amp;'a Body&lt;'tcx&gt;</code>, right?</p>



<a name="179055019"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/179055019" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#179055019">(Oct 25 2019 at 14:37)</a>:</h4>
<p>all <code>MirPass</code>es will require <code>&amp;mut BodyCache&lt;&amp;mut Body&gt;</code>, so you'll always need the latter</p>



<a name="179055026"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/179055026" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#179055026">(Oct 25 2019 at 14:38)</a>:</h4>
<p>the passes may not use the mutability</p>



<a name="179055067"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/179055067" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#179055067">(Oct 25 2019 at 14:38)</a>:</h4>
<p>but that's not a problem</p>



<a name="179056069"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/179056069" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#179056069">(Oct 25 2019 at 14:48)</a>:</h4>
<p>Hm, I may need to fix some things then in the visitors. In order to get the lifetimes in agreement I did what you had recommended re: <code>fn read_only(self) -&gt; ReadOnlyBodyCache&lt;...&gt;</code>, but that's not possible with <code>&amp;mut BodyCache&lt;...&gt;</code> since I can't move out of the reference. The non-mut visitors were updated to only work with <code>ReadOnlyBodyCache</code>.</p>



<a name="179056151"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/179056151" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#179056151">(Oct 25 2019 at 14:49)</a>:</h4>
<p>I'll review later tonight after work</p>



<a name="179056982"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/179056982" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#179056982">(Oct 25 2019 at 14:59)</a>:</h4>
<p>btw, I'm going on vacation tomorrow, I won't be online again until the 4th of November</p>



<a name="179057174"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/179057174" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#179057174">(Oct 25 2019 at 15:01)</a>:</h4>
<p>Enjoy! We'll have a small overlap then since I'll be on vacation from the 7-10th of November.</p>



<a name="179062716"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/179062716" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> vertexclique <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#179062716">(Oct 25 2019 at 15:52)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> Enjoy! I will update you with the latest changes in intrinsic promotion topic when you come back!</p>



<a name="179062853"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/179062853" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#179062853">(Oct 25 2019 at 15:53)</a>:</h4>
<p>thx!</p>



<a name="179892879"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/179892879" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#179892879">(Nov 05 2019 at 00:57)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> welcome back! I hope it was a wonderful vacation. In your absence I got <a href="https://github.com/rust-lang/rust/pull/64736" target="_blank" title="https://github.com/rust-lang/rust/pull/64736">https://github.com/rust-lang/rust/pull/64736</a> fully compiling, passing tests, and reasonably cleaned up. I was wondering if you think the variable renames all over the place were overkill (I can undo them if it makes the code easier to read). I also left a comment on one area I really dislike, but not sure how to clean up. Either way I think this version makes me much more comfortable than the one that relied on unwraps/asserts more often.</p>



<a name="179912830"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/179912830" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#179912830">(Nov 05 2019 at 09:04)</a>:</h4>
<p>slowly catching up :D</p>



<a name="179912844"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/179912844" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#179912844">(Nov 05 2019 at 09:04)</a>:</h4>
<p>I have 400 new messages from github and around 20 pings on zulip</p>



<a name="179930221"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/179930221" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#179930221">(Nov 05 2019 at 13:16)</a>:</h4>
<p>e_O</p>



<a name="179930289"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/179930289" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#179930289">(Nov 05 2019 at 13:17)</a>:</h4>
<p>No rush. I'll help out in the rustc guide for the time being</p>



<a name="180139093"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/180139093" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#180139093">(Nov 07 2019 at 14:52)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> anything else I should look at in my PR? Also, did you ever see my comments in the PR about the <code>mir_built</code> query?</p>



<a name="180139148"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/180139148" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#180139148">(Nov 07 2019 at 14:52)</a>:</h4>
<p>Wanted to see if I could take care of anything before I head out before vacation. I still have a few hours today</p>



<a name="180220548"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/180220548" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#180220548">(Nov 08 2019 at 11:15)</a>:</h4>
<p>I responded on the PR</p>



<a name="180220610"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/180220610" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#180220610">(Nov 08 2019 at 11:16)</a>:</h4>
<p>I'm not quite sure why you need the readonly thing. Couldn't <code>&amp;CachedBody</code> work similarly?</p>



<a name="180424355"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/180424355" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#180424355">(Nov 11 2019 at 13:45)</a>:</h4>
<p>The difference is that <code>ReadOnlyBodyCache</code> is guaranteed to have a computed cache, while <code>&amp;BodyCache</code> is not</p>



<a name="180424436"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/180424436" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#180424436">(Nov 11 2019 at 13:46)</a>:</h4>
<p>Back from vacation. I'll try reviewing this morning, but might not get back to it until late tonight/early tomorrow</p>



<a name="180429896"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/180429896" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#180429896">(Nov 11 2019 at 14:58)</a>:</h4>
<p>hmm... right, so this is helping in not forgetting to pre-generate the cache?</p>



<a name="180446167"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/180446167" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#180446167">(Nov 11 2019 at 18:13)</a>:</h4>
<p>Yes, exactly. I initially thought it was overkill, but it made the cleanup work much easier once I got into it.</p>



<a name="180446539"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/180446539" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#180446539">(Nov 11 2019 at 18:17)</a>:</h4>
<p>ok seems fine then. I still think we can do without cloning though <span aria-label="slight smile" class="emoji emoji-1f642" role="img" title="slight smile">:slight_smile:</span></p>



<a name="180520324"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/180520324" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#180520324">(Nov 12 2019 at 14:19)</a>:</h4>
<p>You're referring to the clone in <code>unsafety_check_result</code>? So I can fix that by ensuring the cache is computed at the end of <code>mir_built</code>, but this will mean that cache is invalidated once it's stolen in <code>mir_const</code> ( <a href="https://github.com/rust-lang/rust/blob/master/src/librustc_mir/transform/mod.rs#L188" target="_blank" title="https://github.com/rust-lang/rust/blob/master/src/librustc_mir/transform/mod.rs#L188">https://github.com/rust-lang/rust/blob/master/src/librustc_mir/transform/mod.rs#L188</a> )</p>



<a name="180522312"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/180522312" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#180522312">(Nov 12 2019 at 14:38)</a>:</h4>
<p>why does stealing invalidate the cache?</p>



<a name="180534429"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/180534429" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#180534429">(Nov 12 2019 at 16:31)</a>:</h4>
<p>Stealing doesn't, but the passes running on it can modify the body, which would invalidate the cache, right?</p>



<a name="180534511"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/180534511" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#180534511">(Nov 12 2019 at 16:32)</a>:</h4>
<p>Sorry, I was referring to what was happening inside of <code>mir_const</code> and not that stealing itself would invalidate the cache</p>



<a name="180534605"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/180534605" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#180534605">(Nov 12 2019 at 16:32)</a>:</h4>
<p>Particularly the run_passes portion of that fn</p>



<a name="180696036"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/180696036" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#180696036">(Nov 14 2019 at 03:04)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span>  I went ahead and implemented your suggestions yesterday. Is there anything other major item? Anything I could improve as well, e.g. comments anywhere within the code, or something else along those lines?</p>



<a name="180725754"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/180725754" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#180725754">(Nov 14 2019 at 12:31)</a>:</h4>
<p>I'll do a round of reviews. I think some documentation explaining things that aren't immediately obvious from readign the code would be good indeed. I'll leave comments wherever I see such situations</p>



<a name="181111199"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/181111199" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#181111199">(Nov 19 2019 at 13:37)</a>:</h4>
<p>Hey <span class="user-mention" data-user-id="124288">@oli</span> , I forgot to follow up last week to ask about inlining. Should I make any attempts at marking the functions inline? Initially I just copied over what was in <code>Body</code>, but not sure if there's a particular approach I should take to figure out the best candidates for marking inline. I.e. if there's any simple benchmarks I can run (outside of triggering a run in through github).</p>



<a name="181111317"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/181111317" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#181111317">(Nov 19 2019 at 13:39)</a>:</h4>
<p>Nah, don't mark things as <code>inline</code> unless there's a good motivation to do so. Don't go chasing for it without a concrete reason. We'll run perf tests and see how it goes</p>



<a name="181114279"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/181114279" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#181114279">(Nov 19 2019 at 14:16)</a>:</h4>
<p>Should I remove the ones that I had added in?</p>



<a name="181116321"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/181116321" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#181116321">(Nov 19 2019 at 14:36)</a>:</h4>
<p>without measurements that would be better, yes</p>



<a name="181214397"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/181214397" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#181214397">(Nov 20 2019 at 14:58)</a>:</h4>
<p>Just got a chance to push up that fix</p>



<a name="181214420"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/181214420" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#181214420">(Nov 20 2019 at 14:58)</a>:</h4>
<p>Going to rebase as well (hopefully not too many conflicts this time)</p>



<a name="181282476"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/181282476" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#181282476">(Nov 21 2019 at 07:40)</a>:</h4>
<p>I did another review. lgtm now. After you rebase I'll trigger the perf run</p>



<a name="182027376"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/182027376" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#182027376">(Nov 27 2019 at 15:07)</a>:</h4>
<p>Hey <span class="user-mention" data-user-id="124288">@oli</span> , so I took a look at the last run, and I'm not sure why it's failing to compile. Is there a specific way to run the build in that instance that's different from <code>./x.py build</code>?</p>



<a name="182027428"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/182027428" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#182027428">(Nov 27 2019 at 15:08)</a>:</h4>
<p>Re <a href="https://dev.azure.com/rust-lang/rust/_build/results?buildId=14488" target="_blank" title="https://dev.azure.com/rust-lang/rust/_build/results?buildId=14488">https://dev.azure.com/rust-lang/rust/_build/results?buildId=14488</a></p>



<a name="182027497"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/182027497" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#182027497">(Nov 27 2019 at 15:09)</a>:</h4>
<p>It looks like it's running <code>x.py dist</code>. I'll try that locally</p>



<a name="182028105"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/182028105" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#182028105">(Nov 27 2019 at 15:16)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/pull/66279" target="_blank" title="https://github.com/rust-lang/rust/pull/66279">https://github.com/rust-lang/rust/pull/66279</a> merged two days ago and removed the <code>impl_stable_hash_for</code> macro which your PR uses. So when CI merges your PR into <code>master</code>, that macro is no longer defined. I think you just need to rebase on top of the latest <code>master</code> and fix the build issues .</p>



<a name="182028727"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/182028727" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#182028727">(Nov 27 2019 at 15:23)</a>:</h4>
<p>Oh that makes a lot more sense <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span> . I incorrectly assumed the lack of merge conflicts in github meant it was something else. Thanks!</p>



<a name="182028894"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Parallel%20rustc%20-%20Mir%20predecessors%20cache/near/182028894" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Parallel.20rustc.20-.20Mir.20predecessors.20cache.html#182028894">(Nov 27 2019 at 15:25)</a>:</h4>
<p>Yeah, git's merge conflict detection algorithm is purely text based and only cares if you changes lines near other lines that were changed when merging. It's pretty easy to fool it.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>